
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>TypeScript里的this · TypeScript Handbook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Patrick Zhong">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="coding_guidelines.html" />
    
    
    <link rel="prev" href="./" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../handbook/tutorials/">
            
                <a href="../handbook/tutorials/">
            
                    
                    快速上手
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../handbook/tutorials/TypeScript in 5 minutes.html">
            
                <a href="../handbook/tutorials/TypeScript in 5 minutes.html">
            
                    
                    5分钟了解TypeScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../handbook/tutorials/ASP.NET Core.html">
            
                <a href="../handbook/tutorials/ASP.NET Core.html">
            
                    
                    ASP.NET Core
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../handbook/tutorials/ASP.NET 4.html">
            
                <a href="../handbook/tutorials/ASP.NET 4.html">
            
                    
                    ASP.NET 4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../handbook/tutorials/Gulp.html">
            
                <a href="../handbook/tutorials/Gulp.html">
            
                    
                    Gulp
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../handbook/tutorials/Knockout.html">
            
                <a href="../handbook/tutorials/Knockout.html">
            
                    
                    Knockout.js
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../handbook/tutorials/React & Webpack.html">
            
                <a href="../handbook/tutorials/React & Webpack.html">
            
                    
                    React与webpack
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="../handbook/tutorials/React.html">
            
                <a href="../handbook/tutorials/React.html">
            
                    
                    React
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="../handbook/tutorials/Angular 2.html">
            
                <a href="../handbook/tutorials/Angular 2.html">
            
                    
                    Angular 2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="../handbook/tutorials/Migrating from JavaScript.html">
            
                <a href="../handbook/tutorials/Migrating from JavaScript.html">
            
                    
                    从JavaScript迁移到TypeScript
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../handbook/">
            
                <a href="../handbook/">
            
                    
                    手册
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../handbook/Basic Types.html">
            
                <a href="../handbook/Basic Types.html">
            
                    
                    基础类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../handbook/Variable Declarations.html">
            
                <a href="../handbook/Variable Declarations.html">
            
                    
                    变量声明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../handbook/Interfaces.html">
            
                <a href="../handbook/Interfaces.html">
            
                    
                    接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../handbook/Classes.html">
            
                <a href="../handbook/Classes.html">
            
                    
                    类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../handbook/Functions.html">
            
                <a href="../handbook/Functions.html">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../handbook/Generics.html">
            
                <a href="../handbook/Generics.html">
            
                    
                    泛型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../handbook/Enums.html">
            
                <a href="../handbook/Enums.html">
            
                    
                    枚举
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="../handbook/Type Inference.html">
            
                <a href="../handbook/Type Inference.html">
            
                    
                    类型推论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="../handbook/Type Compatibility.html">
            
                <a href="../handbook/Type Compatibility.html">
            
                    
                    类型兼容性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="../handbook/Advanced Types.html">
            
                <a href="../handbook/Advanced Types.html">
            
                    
                    高级类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.11" data-path="../handbook/Utilit Types.md">
            
                <span>
            
                    
                    实用工具类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.12" data-path="../handbook/Symbols.html">
            
                <a href="../handbook/Symbols.html">
            
                    
                    Symbols
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.13" data-path="../handbook/Iterators and Generators.html">
            
                <a href="../handbook/Iterators and Generators.html">
            
                    
                    Iterators 和 Generators
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.14" data-path="../handbook/Modules.html">
            
                <a href="../handbook/Modules.html">
            
                    
                    模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.15" data-path="../handbook/Namespaces.html">
            
                <a href="../handbook/Namespaces.html">
            
                    
                    命名空间
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.16" data-path="../handbook/Namespaces and Modules.html">
            
                <a href="../handbook/Namespaces and Modules.html">
            
                    
                    命名空间和模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.17" data-path="../handbook/Module Resolution.html">
            
                <a href="../handbook/Module Resolution.html">
            
                    
                    模块解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.18" data-path="../handbook/Declaration Merging.html">
            
                <a href="../handbook/Declaration Merging.html">
            
                    
                    声明合并
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.19" data-path="../handbook/Writing Definition Files.html">
            
                <a href="../handbook/Writing Definition Files.html">
            
                    
                    书写.d.ts文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.20" data-path="../handbook/JSX.html">
            
                <a href="../handbook/JSX.html">
            
                    
                    JSX
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.21" data-path="../handbook/Decorators.html">
            
                <a href="../handbook/Decorators.html">
            
                    
                    Decorators
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.22" data-path="../handbook/Mixins.html">
            
                <a href="../handbook/Mixins.html">
            
                    
                    混入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.23" data-path="../handbook/Triple-Slash Directives.html">
            
                <a href="../handbook/Triple-Slash Directives.html">
            
                    
                    三斜线指令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.24" data-path="../handbook/Type Checking JavaScript Files.html">
            
                <a href="../handbook/Type Checking JavaScript Files.html">
            
                    
                    JavaScript文件里的类型检查
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../handbook/declaration files/Introduction.html">
            
                <a href="../handbook/declaration files/Introduction.html">
            
                    
                    如何书写声明文件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../handbook/declaration files/Library Structures.html">
            
                <a href="../handbook/declaration files/Library Structures.html">
            
                    
                    结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../handbook/declaration files/Do's and Don'ts.html">
            
                <a href="../handbook/declaration files/Do's and Don'ts.html">
            
                    
                    规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../handbook/declaration files/By Example.html">
            
                <a href="../handbook/declaration files/By Example.html">
            
                    
                    举例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../handbook/declaration files/Deep Dive.html">
            
                <a href="../handbook/declaration files/Deep Dive.html">
            
                    
                    深入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../handbook/declaration files/Publishing.html">
            
                <a href="../handbook/declaration files/Publishing.html">
            
                    
                    发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../handbook/declaration files/Consumption.html">
            
                <a href="../handbook/declaration files/Consumption.html">
            
                    
                    使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../handbook/tsconfig.json.html">
            
                <a href="../handbook/tsconfig.json.html">
            
                    
                    工程配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../handbook/tsconfig.json.html">
            
                <a href="../handbook/tsconfig.json.html">
            
                    
                    tsconfig.json
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../handbook/Project References.html">
            
                <a href="../handbook/Project References.html">
            
                    
                    工程引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../handbook/Typings for NPM Packages.html">
            
                <a href="../handbook/Typings for NPM Packages.html">
            
                    
                    NPM包的类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../handbook/Compiler Options.html">
            
                <a href="../handbook/Compiler Options.html">
            
                    
                    编译选项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../handbook/Configuring Watch.html">
            
                <a href="../handbook/Configuring Watch.html">
            
                    
                    配置 Watch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../handbook/Compiler Options in MSBuild.html">
            
                <a href="../handbook/Compiler Options in MSBuild.html">
            
                    
                    在MSBuild里使用编译选项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="../handbook/Integrating with Build Tools.html">
            
                <a href="../handbook/Integrating with Build Tools.html">
            
                    
                    与其它构建工具整合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="../handbook/Nightly Builds.html">
            
                <a href="../handbook/Nightly Builds.html">
            
                    
                    使用TypeScript的每日构建版本
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="./">
            
                <a href="./">
            
                    
                    Wiki
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.6.1" data-path="this-in-TypeScript.html">
            
                <a href="this-in-TypeScript.html">
            
                    
                    TypeScript里的this
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="coding_guidelines.html">
            
                <a href="coding_guidelines.html">
            
                    
                    编码规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="Common Errors.html">
            
                <a href="Common Errors.html">
            
                    
                    常见编译错误
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="TypeScript-Editor-Support.html">
            
                <a href="TypeScript-Editor-Support.html">
            
                    
                    支持TypeScript的编辑器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="Using-TypeScript-With-ASP.NET-5.html">
            
                <a href="Using-TypeScript-With-ASP.NET-5.html">
            
                    
                    结合ASP.NET v5使用TypeScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="Architectural-Overview.html">
            
                <a href="Architectural-Overview.html">
            
                    
                    架构概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="Roadmap.html">
            
                <a href="Roadmap.html">
            
                    
                    发展路线图
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../release-notes/">
            
                <a href="../release-notes/">
            
                    
                    新增功能
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../release-notes/TypeScript 3.1.html">
            
                <a href="../release-notes/TypeScript 3.1.html">
            
                    
                    TypeScript 3.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../release-notes/TypeScript 3.0.html">
            
                <a href="../release-notes/TypeScript 3.0.html">
            
                    
                    TypeScript 3.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../release-notes/TypeScript 2.9.html">
            
                <a href="../release-notes/TypeScript 2.9.html">
            
                    
                    TypeScript 2.9
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../release-notes/TypeScript 2.8.html">
            
                <a href="../release-notes/TypeScript 2.8.html">
            
                    
                    TypeScript 2.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../release-notes/TypeScript 2.7.html">
            
                <a href="../release-notes/TypeScript 2.7.html">
            
                    
                    TypeScript 2.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="../release-notes/TypeScript 2.6.html">
            
                <a href="../release-notes/TypeScript 2.6.html">
            
                    
                    TypeScript 2.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="../release-notes/TypeScript 2.5.html">
            
                <a href="../release-notes/TypeScript 2.5.html">
            
                    
                    TypeScript 2.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.8" data-path="../release-notes/TypeScript 2.4.html">
            
                <a href="../release-notes/TypeScript 2.4.html">
            
                    
                    TypeScript 2.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.9" data-path="../release-notes/TypeScript 2.3.html">
            
                <a href="../release-notes/TypeScript 2.3.html">
            
                    
                    TypeScript 2.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.10" data-path="../release-notes/TypeScript 2.2.html">
            
                <a href="../release-notes/TypeScript 2.2.html">
            
                    
                    TypeScript 2.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.11" data-path="../release-notes/TypeScript 2.1.html">
            
                <a href="../release-notes/TypeScript 2.1.html">
            
                    
                    TypeScript 2.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.12" data-path="../release-notes/TypeScript 2.0.html">
            
                <a href="../release-notes/TypeScript 2.0.html">
            
                    
                    TypeScript 2.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.13" data-path="../release-notes/TypeScript 1.8.html">
            
                <a href="../release-notes/TypeScript 1.8.html">
            
                    
                    TypeScript 1.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.14" data-path="../release-notes/TypeScript 1.7.html">
            
                <a href="../release-notes/TypeScript 1.7.html">
            
                    
                    TypeScript 1.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.15" data-path="../release-notes/TypeScript 1.6.html">
            
                <a href="../release-notes/TypeScript 1.6.html">
            
                    
                    TypeScript 1.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.16" data-path="../release-notes/TypeScript 1.5.html">
            
                <a href="../release-notes/TypeScript 1.5.html">
            
                    
                    TypeScript 1.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.17" data-path="../release-notes/TypeScript 1.4.html">
            
                <a href="../release-notes/TypeScript 1.4.html">
            
                    
                    TypeScript 1.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.18" data-path="../release-notes/TypeScript 1.3.html">
            
                <a href="../release-notes/TypeScript 1.3.html">
            
                    
                    TypeScript 1.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.19" data-path="../release-notes/TypeScript 1.1.html">
            
                <a href="../release-notes/TypeScript 1.1.html">
            
                    
                    TypeScript 1.1
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../breaking-changes/breaking-changes.html">
            
                <a href="../breaking-changes/breaking-changes.html">
            
                    
                    Breaking Changes
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../breaking-changes/TypeScript 2.4.html">
            
                <a href="../breaking-changes/TypeScript 2.4.html">
            
                    
                    TypeScript 2.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../breaking-changes/TypeScript 2.3.html">
            
                <a href="../breaking-changes/TypeScript 2.3.html">
            
                    
                    TypeScript 2.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../breaking-changes/TypeScript 2.2.html">
            
                <a href="../breaking-changes/TypeScript 2.2.html">
            
                    
                    TypeScript 2.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../breaking-changes/TypeScript 2.1.html">
            
                <a href="../breaking-changes/TypeScript 2.1.html">
            
                    
                    TypeScript 2.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../breaking-changes/TypeScript 2.0.html">
            
                <a href="../breaking-changes/TypeScript 2.0.html">
            
                    
                    TypeScript 2.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="../breaking-changes/TypeScript 1.8.html">
            
                <a href="../breaking-changes/TypeScript 1.8.html">
            
                    
                    TypeScript 1.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="../breaking-changes/TypeScript 1.7.html">
            
                <a href="../breaking-changes/TypeScript 1.7.html">
            
                    
                    TypeScript 1.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="../breaking-changes/TypeScript 1.6.html">
            
                <a href="../breaking-changes/TypeScript 1.6.html">
            
                    
                    TypeScript 1.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.9" data-path="../breaking-changes/TypeScript 1.5.html">
            
                <a href="../breaking-changes/TypeScript 1.5.html">
            
                    
                    TypeScript 1.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.10" data-path="../breaking-changes/TypeScript 1.4.html">
            
                <a href="../breaking-changes/TypeScript 1.4.html">
            
                    
                    TypeScript 1.4
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >TypeScript里的this</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x4ECB;&#x7ECD;">&#x4ECB;&#x7ECD;</h2>
<p>&#x5728;JavaScript&#x91CC;&#xFF08;&#x8FD8;&#x6709;TypeScript&#xFF09;&#xFF0C;<code>this</code>&#x5173;&#x952E;&#x5B57;&#x7684;&#x884C;&#x4E3A;&#x4E0E;&#x5176;&#x5B83;&#x8BED;&#x8A00;&#x76F8;&#x6BD4;&#x5927;&#x4E3A;&#x4E0D;&#x540C;&#x3002;&#x8FD9;&#x53EF;&#x80FD;&#x4F1A;&#x5F88;&#x4EE4;&#x4EBA;&#x5403;&#x60CA;&#xFF0C;&#x7279;&#x522B;&#x662F;&#x5BF9;&#x4E8E;&#x90A3;&#x4E9B;&#x4F7F;&#x7528;&#x5176;&#x5B83;&#x8BED;&#x8A00;&#x7684;&#x7528;&#x6237;&#xFF0C;&#x4ED6;&#x4EEC;&#x51ED;&#x501F;&#x5176;&#x76F4;&#x89C9;&#x6765;&#x60F3;&#x8C61;<code>this</code>&#x5173;&#x952E;&#x5B57;&#x7684;&#x884C;&#x4E3A;&#x3002;</p>
<p>&#x8FD9;&#x7BC7;&#x6587;&#x7AE0;&#x4F1A;&#x6559;&#x4F60;&#x600E;&#x4E48;&#x8BC6;&#x522B;&#x53CA;&#x8C03;&#x8BD5;TypeScript&#x91CC;&#x7684;<code>this</code>&#x95EE;&#x9898;&#xFF0C;&#x5E76;&#x4E14;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E9B;&#x89E3;&#x51B3;&#x65B9;&#x6848;&#x548C;&#x5404;&#x81EA;&#x7684;&#x5229;&#x5F0A;&#x3002;</p>
<h2 id="&#x5178;&#x578B;&#x75C7;&#x72B6;&#x548C;&#x5371;&#x9669;&#x7CFB;&#x6570;">&#x5178;&#x578B;&#x75C7;&#x72B6;&#x548C;&#x5371;&#x9669;&#x7CFB;&#x6570;</h2>
<p>&#x4E22;&#x5931;<code>this</code>&#x4E0A;&#x4E0B;&#x6587;&#x7684;&#x5178;&#x578B;&#x75C7;&#x72B6;&#x5305;&#x62EC;&#xFF1A;</p>
<ul>
<li>&#x7C7B;&#x7684;&#x67D0;&#x5B57;&#x6BB5;&#xFF08;<code>this.foo</code>&#xFF09;&#x4E3A;<code>undefined</code>&#xFF0C;&#x4F46;&#x5176;&#x5B83;&#x503C;&#x6CA1;&#x6709;&#x95EE;&#x9898;</li>
<li><code>this</code>&#x7684;&#x503C;&#x6307;&#x5411;&#x5168;&#x5C40;&#x7684;<code>window</code>&#x5BF9;&#x8C61;&#x800C;&#x4E0D;&#x662F;&#x7C7B;&#x5B9E;&#x4F8B;&#x5BF9;&#x8C61;&#xFF08;&#x5728;&#x975E;&#x4E25;&#x683C;&#x6A21;&#x5F0F;&#x4E0B;&#xFF09;</li>
<li><code>this</code>&#x7684;&#x503C;&#x4E3A;<code>undefined</code>&#x800C;&#x4E0D;&#x662F;&#x7C7B;&#x5B9E;&#x4F8B;&#x5BF9;&#x8C61;&#xFF08;&#x4E25;&#x683C;&#x6A21;&#x5F0F;&#x4E0B;&#xFF09;</li>
<li>&#x8C03;&#x7528;&#x7C7B;&#x65B9;&#x6CD5;&#xFF08;<code>this.doBa()</code>&#xFF09;&#x5931;&#x8D25;&#xFF0C;&#x9519;&#x8BEF;&#x4FE1;&#x606F;&#x5982;&#x201C;TypeError: undefined is not a function&#x201D;&#xFF0C;&#x201C;Object doesn&apos;t support property or method &apos;doBar&apos;&#x201D;&#x6216;&#x201C;this.doBar is not a function&#x201D;</li>
</ul>
<p>&#x7A0B;&#x5E8F;&#x4E2D;&#x5E94;&#x8BE5;&#x51FA;&#x73B0;&#x4E86;&#x4EE5;&#x4E0B;&#x4EE3;&#x7801;&#xFF1A;</p>
<ul>
<li>&#x4E8B;&#x4EF6;&#x76D1;&#x542C;&#xFF0C;&#x6BD4;&#x5982;<code>window.addEventListener(&apos;click&apos;, myClass.doThing);</code></li>
<li>Promise&#x89E3;&#x51B3;&#xFF0C;&#x6BD4;&#x5982;<code>myPromise.then(myClass.theNextThing);</code></li>
<li>&#x7B2C;&#x4E09;&#x65B9;&#x5E93;&#x56DE;&#x8C03;&#xFF0C;&#x6BD4;&#x5982;<code>$(document).ready(myClass.start);</code></li>
<li>&#x51FD;&#x6570;&#x56DE;&#x8C03;&#xFF0C;&#x6BD4;&#x5982;<code>someArray.map(myClass.convert)</code></li>
<li>ViewModel&#x7C7B;&#x578B;&#x7684;&#x5E93;&#x91CC;&#x7684;&#x7C7B;&#xFF0C;&#x6BD4;&#x5982;<code>&lt;div data-bind=&quot;click: myClass.doSomething&quot;&gt;</code></li>
<li>&#x53EF;&#x9009;&#x5305;&#x91CC;&#x7684;&#x51FD;&#x6570;&#xFF0C;&#x6BD4;&#x5982;<code>$.ajax(url, { success: myClass.handleData })</code></li>
</ul>
<h2 id="javascript&#x91CC;&#x7684;this&#x7A76;&#x7ADF;&#x662F;&#x4EC0;&#x4E48;&#xFF1F;">JavaScript&#x91CC;&#x7684;<code>this</code>&#x7A76;&#x7ADF;&#x662F;&#x4EC0;&#x4E48;&#xFF1F;</h2>
<p>&#x5DF2;&#x7ECF;&#x6709;&#x5927;&#x91CF;&#x7684;&#x6587;&#x7AE0;&#x8BB2;&#x8FF0;&#x4E86;JavaScript&#x91CC;<code>this</code>&#x5173;&#x952E;&#x5B57;&#x7684;&#x5371;&#x9669;&#x6027;&#x3002;&#x67E5;&#x770B;<a href="http://www.quirksmode.org/js/this.html" target="_blank">&#x8FD9;&#x91CC;</a>&#xFF0C;<a href="http://javascriptissexy.com/understand-javascripts-this-with-clarity-and-master-it/" target="_blank">&#x8FD9;&#x91CC;</a>&#xFF0C;&#x6216;<a href="http://bjorn.tipling.com/all-this" target="_blank">&#x8FD9;&#x91CC;</a>&#x3002;</p>
<p>&#x5F53;JavaScript&#x91CC;&#x7684;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#x88AB;&#x8C03;&#x7528;&#x65F6;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x6309;&#x7167;&#x4E0B;&#x9762;&#x7684;&#x987A;&#x5E8F;&#x6765;&#x63A8;&#x65AD;&#x51FA;<code>this</code>&#x6307;&#x5411;&#x7684;&#x662F;&#x4EC0;&#x4E48;&#xFF08;&#x8FD9;&#x4E9B;&#x89C4;&#x5219;&#x662F;&#x6309;&#x4F18;&#x5148;&#x7EA7;&#x987A;&#x5E8F;&#x6392;&#x5217;&#x7684;&#xFF09;&#xFF1A;</p>
<ul>
<li>&#x5982;&#x679C;&#x8FD9;&#x4E2A;&#x51FD;&#x6570;&#x662F;<code>function#bind</code>&#x8C03;&#x7528;&#x7684;&#x7ED3;&#x679C;&#xFF0C;&#x90A3;&#x4E48;<code>this</code>&#x6307;&#x5411;&#x7684;&#x662F;&#x4F20;&#x5165;<code>bind</code>&#x7684;&#x53C2;&#x6570;</li>
<li>&#x5982;&#x679C;&#x51FD;&#x6570;&#x662F;&#x4EE5;<code>foo.func()</code>&#x5F62;&#x5F0F;&#x8C03;&#x7528;&#x7684;&#xFF0C;&#x90A3;&#x4E48;<code>this</code>&#x503C;&#x4E3A;<code>foo</code></li>
<li>&#x5982;&#x679C;&#x662F;&#x5728;&#x4E25;&#x683C;&#x6A21;&#x5F0F;&#x4E0B;&#xFF0C;<code>this</code>&#x5C06;&#x4E3A;<code>undefined</code></li>
<li>&#x5426;&#x5219;&#xFF0C;<code>this</code>&#x5C06;&#x662F;&#x5168;&#x5C40;&#x5BF9;&#x8C61;&#xFF08;&#x6D4F;&#x89C8;&#x5668;&#x73AF;&#x5883;&#x91CC;&#x4E3A;<code>window</code>&#xFF09;</li>
</ul>
<p>&#x8FD9;&#x4E9B;&#x89C4;&#x5219;&#x4F1A;&#x4EA7;&#x751F;&#x4E0E;&#x76F4;&#x89C9;&#x76F8;&#x53CD;&#x7684;&#x6548;&#x679C;&#x3002;&#x6BD4;&#x5982;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">class</span> Foo {
  x = <span class="hljs-number">3</span>;
  print() {
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;x is &apos;</span> + <span class="hljs-keyword">this</span>.x);
  }
}

<span class="hljs-keyword">var</span> f = <span class="hljs-keyword">new</span> Foo();
f.print(); <span class="hljs-comment">// Prints &apos;x is 3&apos; as expected</span>

<span class="hljs-comment">// Use the class method in an object literal</span>
<span class="hljs-keyword">var</span> z = { x: <span class="hljs-number">10</span>, p: f.print };
z.p(); <span class="hljs-comment">// Prints &apos;x is 10&apos;</span>

<span class="hljs-keyword">var</span> p = z.p;
p(); <span class="hljs-comment">// Prints &apos;x is undefined&apos;</span>
</code></pre>
<h2 id="this&#x7684;&#x5371;&#x9669;&#x4FE1;&#x53F7;"><code>this</code>&#x7684;&#x5371;&#x9669;&#x4FE1;&#x53F7;</h2>
<p>&#x4F60;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x6700;&#x5927;&#x7684;&#x5371;&#x9669;&#x4FE1;&#x53F7;&#x662F;<em>&#x5728;&#x8981;&#x4F7F;&#x7528;&#x7C7B;&#x7684;&#x65B9;&#x6CD5;&#x65F6;&#x6CA1;&#x6709;&#x7ACB;&#x5373;&#x8C03;&#x7528;&#x5B83;</em>&#x3002;&#x4EFB;&#x4F55;&#x65F6;&#x5019;&#x4F60;&#x770B;&#x5230;&#x7C7B;&#x65B9;&#x6CD5;&#x88AB;<em>&#x5F15;&#x7528;&#x4E86;</em>&#x5374;&#x6CA1;&#x6709;&#x4F7F;&#x7528;&#x76F8;&#x540C;&#x7684;&#x8868;&#x8FBE;&#x5F0F;&#x6765;<em>&#x8C03;&#x7528;</em>&#x65F6;&#xFF0C;<code>this</code>&#x53EF;&#x80FD;&#x5DF2;&#x7ECF;&#x4E0D;&#x5BF9;&#x4E86;&#x3002;</p>
<p>&#x4F8B;&#x5B50;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">var</span> x = <span class="hljs-keyword">new</span> MyObject();
x.printThing(); <span class="hljs-comment">// SAFE, method is invoked where it is referenced</span>

<span class="hljs-keyword">var</span> y = x.printThing; <span class="hljs-comment">// DANGER, invoking &apos;y()&apos; may not have correct &apos;this&apos;</span>

<span class="hljs-built_in">window</span>.addEventListener(<span class="hljs-string">&apos;click&apos;</span>, x.printThing, <span class="hljs-number">10</span>); <span class="hljs-comment">// DANGER, method is not invoked where it is referenced</span>

<span class="hljs-built_in">window</span>.addEventListener(<span class="hljs-string">&apos;click&apos;</span>, () =&gt; x.printThing(), <span class="hljs-number">10</span>); <span class="hljs-comment">// SAFE, method is invoked in the same expression</span>
</code></pre>
<h2 id="&#x4FEE;&#x590D;">&#x4FEE;&#x590D;</h2>
<p>&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4E00;&#x4E9B;&#x65B9;&#x6CD5;&#x6765;&#x4FDD;&#x6301;<code>this</code>&#x7684;&#x4E0A;&#x4E0B;&#x6587;&#x3002;</p>
<h3 id="&#x4F7F;&#x7528;&#x5B9E;&#x4F8B;&#x51FD;&#x6570;">&#x4F7F;&#x7528;&#x5B9E;&#x4F8B;&#x51FD;&#x6570;</h3>
<p>&#x4EE3;&#x66FF;TypeScript&#x91CC;&#x9ED8;&#x8BA4;&#x7684;<em>&#x539F;&#x578B;</em>&#x65B9;&#x6CD5;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x4E00;&#x4E2A;<em>&#x5B9E;&#x4F8B;&#x7BAD;&#x5934;&#x51FD;&#x6570;</em>&#x6765;&#x5B9A;&#x4E49;&#x7C7B;&#x6210;&#x5458;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">class</span> MyClass {
    <span class="hljs-keyword">private</span> status = <span class="hljs-string">&quot;blah&quot;</span>;

    <span class="hljs-keyword">public</span> run = () =&gt; { <span class="hljs-comment">// &lt;-- note syntax here</span>
        alert(<span class="hljs-keyword">this</span>.status);
    }
}
<span class="hljs-keyword">var</span> x = <span class="hljs-keyword">new</span> MyClass();
$(<span class="hljs-built_in">document</span>).ready(x.run); <span class="hljs-comment">// SAFE, &apos;run&apos; will always have correct &apos;this&apos;</span>
</code></pre>
<ul>
<li>&#x597D;&#x4E0E;&#x574F;&#xFF1A;&#x8FD9;&#x4F1A;&#x4E3A;&#x6BCF;&#x4E2A;&#x7C7B;&#x5B9E;&#x4F8B;&#x7684;&#x6BCF;&#x4E2A;&#x65B9;&#x6CD5;&#x521B;&#x5EFA;&#x989D;&#x5916;&#x7684;&#x95ED;&#x5305;&#x3002;&#x5982;&#x679C;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x901A;&#x5E38;&#x662F;&#x6B63;&#x5E38;&#x8C03;&#x7528;&#x7684;&#xFF0C;&#x90A3;&#x4E48;&#x8FD9;&#x4E48;&#x505A;&#x6709;&#x70B9;&#x8FC7;&#x4E86;&#x3002;&#x7136;&#x800C;&#xFF0C;&#x5B83;&#x7ECF;&#x5E38;&#x4F1A;&#x5728;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x91CC;&#x8C03;&#x7528;&#xFF0C;&#x8BA9;&#x7C7B;&#x5B9E;&#x4F8B;&#x6355;&#x83B7;&#x5230;<code>this</code>&#x4E0A;&#x4E0B;&#x6587;&#x4F1A;&#x6BD4;&#x5728;&#x6BCF;&#x6B21;&#x8C03;&#x7528;&#x65F6;&#x90FD;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x95ED;&#x5305;&#x6765;&#x5F97;&#x66F4;&#x6709;&#x6548;&#x7387;&#x4E00;&#x4E9B;&#x3002;</li>
<li>&#x597D;&#xFF1A;&#x5176;&#x5B83;&#x5916;&#x90E8;&#x4F7F;&#x7528;&#x8005;&#x4E0D;&#x53EF;&#x80FD;&#x5FD8;&#x8BB0;&#x5904;&#x7406;<code>this</code>&#x4E0A;&#x4E0B;&#x6587;</li>
<li>&#x597D;&#xFF1A;&#x5728;TypeScript&#x91CC;&#x662F;&#x7C7B;&#x578B;&#x5B89;&#x5168;&#x7684;</li>
<li>&#x597D;&#xFF1A;&#x5982;&#x679C;&#x51FD;&#x6570;&#x5E26;&#x53C2;&#x6570;&#x4E0D;&#x9700;&#x8981;&#x989D;&#x5916;&#x7684;&#x5DE5;&#x4F5C;</li>
<li>&#x574F;&#xFF1A;&#x6D3E;&#x751F;&#x7C7B;&#x4E0D;&#x80FD;&#x901A;&#x8FC7;&#x4F7F;&#x7528;<code>super</code>&#x8C03;&#x7528;&#x57FA;&#x7C7B;&#x65B9;&#x6CD5;</li>
<li>&#x574F;&#xFF1A;&#x5728;&#x7C7B;&#x4E0E;&#x7528;&#x6237;&#x4E4B;&#x524D;&#x4EA7;&#x751F;&#x4E86;&#x989D;&#x5916;&#x7684;&#x975E;&#x7C7B;&#x578B;&#x5B89;&#x5168;&#x7684;&#x7EA6;&#x675F;&#xFF1A;&#x660E;&#x786E;&#x4E86;&#x54EA;&#x4E9B;&#x65B9;&#x6CD5;&#x63D0;&#x524D;&#x7ED1;&#x5B9A;&#x4E86;&#x4EE5;&#x53CA;&#x54EA;&#x4E9B;&#x6CA1;&#x6709;</li>
</ul>
<h3 id="&#x672C;&#x5730;&#x7684;&#x80D6;&#x7BAD;&#x5934;">&#x672C;&#x5730;&#x7684;&#x80D6;&#x7BAD;&#x5934;</h3>
<p>&#x5728;TypeScrip&#x91CC;&#xFF08;&#x8FD9;&#x91CC;&#x4E3A;&#x4E86;&#x8BB2;&#x89E3;&#x6DFB;&#x52A0;&#x4E86;&#x4E00;&#x4E9B;&#x53C2;&#x6570;&#xFF09; :</p>
<pre><code class="lang-ts"><span class="hljs-keyword">var</span> x = <span class="hljs-keyword">new</span> SomeClass();
someCallback((n, m) =&gt; x.doSomething(n, m));
</code></pre>
<ul>
<li>&#x597D;&#x4E0E;&#x574F;&#xFF1A;&#x5185;&#x5B58;/&#x6548;&#x80FD;&#x4E0A;&#x7684;&#x5229;&#x5F0A;&#x4E0E;&#x5B9E;&#x4F8B;&#x51FD;&#x6570;&#x76F8;&#x6BD4;&#x6B63;&#x76F8;&#x53CD;</li>
<li>&#x597D;&#xFF1A;&#x5728;TypeScript&#xFF0C;100%&#x7684;&#x7C7B;&#x578B;&#x5B89;&#x5168;</li>
<li>&#x597D;&#xFF1A;&#x5728;ECMAScript 3&#x91CC;&#x540C;&#x6837;&#x751F;&#x6548;</li>
<li>&#x597D;&#xFF1A;&#x4F60;&#x53EA;&#x9700;&#x8981;&#x8F93;&#x5165;&#x4E00;&#x6B21;&#x5B9E;&#x4F8B;&#x540D;</li>
<li>&#x574F;&#xFF1A;&#x4F60;&#x8981;&#x8F93;&#x51FA;2&#x6B21;&#x53C2;&#x6570;&#x540D;</li>
<li>&#x574F;&#xFF1A;&#x5BF9;&#x4E8E;&#x53EF;&#x53D8;&#x53C2;&#x6570;&#x4E0D;&#x8D77;&#x4F5C;&#x7528;&#xFF08;&apos;rest&apos;&#xFF09;</li>
</ul>
<h3 id="functionbind">Function.bind</h3>
<pre><code class="lang-ts"><span class="hljs-keyword">var</span> x = <span class="hljs-keyword">new</span> SomeClass();
<span class="hljs-comment">// SAFE: Functions created from function.bind are always preserve &apos;this&apos;</span>
<span class="hljs-built_in">window</span>.setTimeout(x.someMethod.bind(x), <span class="hljs-number">100</span>);
</code></pre>
<ul>
<li>&#x597D;&#x4E0E;&#x574F;&#xFF1A;&#x5185;&#x5B58;/&#x6548;&#x80FD;&#x4E0A;&#x7684;&#x5229;&#x5F0A;&#x4E0E;&#x5B9E;&#x4F8B;&#x51FD;&#x6570;&#x76F8;&#x6BD4;&#x6B63;&#x76F8;&#x53CD;</li>
<li>&#x597D;&#xFF1A;&#x5982;&#x679C;&#x51FD;&#x6570;&#x5E26;&#x53C2;&#x6570;&#x4E0D;&#x9700;&#x8981;&#x989D;&#x5916;&#x7684;&#x5DE5;&#x4F5C;</li>
<li>&#x574F;&#xFF1A;&#x76EE;&#x524D;&#x5728;TypeScript&#x91CC;&#xFF0C;&#x4E0D;&#x662F;&#x7C7B;&#x578B;&#x5B89;&#x5168;&#x7684;</li>
<li>&#x574F;&#xFF1A;&#x53EA;&#x5728;ECMAScript 5&#x91CC;&#x751F;&#x6548;</li>
<li>&#x574F;&#xFF1A;&#x4F60;&#x8981;&#x8F93;&#x5165;2&#x6B21;&#x5B9E;&#x4F8B;&#x540D;</li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="./" class="navigation navigation-prev " aria-label="Previous page: Wiki">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="coding_guidelines.html" class="navigation navigation-next " aria-label="Next page: 编码规范">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"TypeScript里的this","level":"1.6.1","depth":2,"next":{"title":"编码规范","level":"1.6.2","depth":2,"path":"doc/wiki/coding_guidelines.md","ref":"./doc/wiki/coding_guidelines.md","articles":[]},"previous":{"title":"Wiki","level":"1.6","depth":1,"path":"doc/wiki/README.md","ref":"./doc/wiki/README.md","articles":[{"title":"TypeScript里的this","level":"1.6.1","depth":2,"path":"doc/wiki/this-in-TypeScript.md","ref":"./doc/wiki/this-in-TypeScript.md","articles":[]},{"title":"编码规范","level":"1.6.2","depth":2,"path":"doc/wiki/coding_guidelines.md","ref":"./doc/wiki/coding_guidelines.md","articles":[]},{"title":"常见编译错误","level":"1.6.3","depth":2,"path":"doc/wiki/Common Errors.md","ref":"./doc/wiki/Common Errors.md","articles":[]},{"title":"支持TypeScript的编辑器","level":"1.6.4","depth":2,"path":"doc/wiki/TypeScript-Editor-Support.md","ref":"./doc/wiki/TypeScript-Editor-Support.md","articles":[]},{"title":"结合ASP.NET v5使用TypeScript","level":"1.6.5","depth":2,"path":"doc/wiki/Using-TypeScript-With-ASP.NET-5.md","ref":"./doc/wiki/Using-TypeScript-With-ASP.NET-5.md","articles":[]},{"title":"架构概述","level":"1.6.6","depth":2,"path":"doc/wiki/Architectural-Overview.md","ref":"./doc/wiki/Architectural-Overview.md","articles":[]},{"title":"发展路线图","level":"1.6.7","depth":2,"path":"doc/wiki/Roadmap.md","ref":"./doc/wiki/Roadmap.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Patrick Zhong","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"preface.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"TypeScript Handbook","language":"zh-hans","gitbook":">3.0.0","description":"Translation of official TypeScript Handbook"},"file":{"path":"doc/wiki/this-in-TypeScript.md","mtime":"2018-10-13T09:48:54.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-13T09:57:42.904Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

